<html xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
	<title>资源定义列表</title>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">

	<script src="../../static/bootstrap/js/jquery-3.4.1.min.js" type="text/javascript"></script>
	<script src="../../static/bootstrap/js/static-resources.js"></script>
	<!--zTree js-->
	<link rel="stylesheet" href="../../static/bootstrap/js/ztree/zTreeStyle/zTreeStyle.css" type="text/css">
	<script src="../../static/bootstrap/js/ztree/jquery.ztree.all.min.js"></script>
	<script src="https://cdn.bootcss.com/bootstrap-select/1.13.7/js/bootstrap-select.min.js"></script>
	<script src="https://cdn.bootcss.com/bootstrap-select/2.0.0-beta1/js/i18n/defaults-zh_CN.min.js"></script>
	<style type="text/css">
		.ztree li span.button.add {margin-left:2px; margin-right: -1px; background-position:-144px 0; vertical-align:top; *vertical-align:middle}
	</style>
<script type="text/javascript">
	$(function () {
		$(".footerPage").load("../footer.html");
		let DEFAULT_DATA_MODEL = {
			"actid":"",
			"descr":"",
			"resourceid":"",
		};
		// 菜单资源数据类型
		let DEFAULT_RESOURCE_MODEL = {
			"resourceid":"",
			"cnname":"",
			"url":"",
			"parentid":"",
			"orderid":"",
			"systempk":"",
		};
		new Vue({
			el : '#app',
			mixins: [window.$DEFAULT_MIXIN],
			data: {
				queryParam: {
					"resourceid":"",
					"cnname":"",
					"url":"",
					"parentid":"",
					"orderid":"",
					"systempk":[],
				},
				pageInfo: {
					page: 1,
					size: 10,
					total: 0
				},
                options:[],
				list:[],
				selected: null,
				show: false,
				readonly: false,
				loading: false,
                roleno:"",
				modelTitle:"",
				dataObj: {},
				opType: "",
                result_list:[],
				// 菜单树形数据
				resoureTree: [],
				ztreeObj: null,

				subDict: [],
				showResourceModel: false,
				resourceModelTitle:"",
				resourceModelObj: {},
				selectResource: null,
			},
			watch:{
				opType(val, old){
					if (val == "add") {
						this.modelTitle = "资源操作新增";
						this.show = true;
						this.readonly = false;
						this.dataObj = $.extend({}, DEFAULT_DATA_MODEL);
					} else if (val == "update") {
						this.modelTitle = "资源操作修改";
						this.show = true;
						this.readonly = false;
						this.dataObj = $.extend({}, this.selected);
					} else if (val == "view") {
						this.modelTitle = "资源操作详情";
						this.show = true;
						this.readonly = true;
						this.dataObj = $.extend({}, this.selected);
					}
					this.dataObj.resourceid = this.queryParam.resourceid;
				},
                /**
                 * 监听后端的返回结果集
                 */
                result_list:function () {
                    this.$nextTick(function () {
                        $('#sel').selectpicker('refresh');
                    })
                },
			},
			computed:{
				paths(){
					return [
						{text: '首页', href: '/index.html'},
						{text: '系统设置', href: '#'},
						{text: '资源管理', href: '#'},
						{text: '资源定义', href: 'batch-console/SResourceList.html'},
					]
				},
				fields(){
					return [
						{key:"actid", label:"操作ID", sortable:false},
						{key:"descr", label:"操作描述", sortable:false}
					]
				},
				ZTREE_SETTINGS: function(){
					let self = this;
					return  {
						view: {
							addHoverDom: function(treeId, treeNode) {
								let sObj = $("#" + treeNode.tId + "_span");
								if (treeNode.editNameFlag || $("#addBtn_" + treeNode.tId).length > 0) return;
								let addStr = "<span class='button add' id='addBtn_" + treeNode.tId
										+ "' title='新增' onfocus='this.blur();'></span>";
								sObj.after(addStr);
								let btn = $("#addBtn_" + treeNode.tId);
								if (btn) btn.on("click", (e)=> {
									e.preventDefault();
									self.addResource(false, treeNode);
									return false;
								});
							},
							removeHoverDom: function(treeId, treeNode) {
								$("#addBtn_" + treeNode.tId).unbind().remove();
							},
							selectedMulti: false
						},
						edit: {
							enable: true,
							showRenameBtn: false,
							showRemoveBtn: true,
							removeTitle: "删除",
						},
						data: {
							key: {
								name: "text",
								title: "text",
								children: "children",
								url: "",
							},
							simpleData: {
								enable: true,
								idKey: "id",
								pIdKey: "parentId",
							},
							keep: {
								parent: true,
								left: true
							}
						},
						callback: {
							//禁止拖拽
							beforeDrag: function(treeId, treeNodes) {
								return false;
							},
							beforeDrop: function(treeId, treeNodes, targetNode, moveType) {
								return false;
							},
							onClick: (e, treeId, treeNode) =>{
								this.handleTreeNodeClick(treeNode);
							},
							beforeRemove: (treeId, treeNode) =>{
								this.$bvModal.msgBoxConfirm(`删除资源会联动向下删除该资源下的所有子资源及资源关联配置信息，确认删除?`, {
									title: '删除提示',
									size: 'md',
									buttonSize: 'sm',
									okVariant: 'success',
									headerClass: 'p-2 border-bottom-0',
									footerClass: 'p-2 border-top-0',
									cancelTitle: "取消",
									okTitle: "确定",
									centered: true
								}).then(value => {
									if (!value) return;
									JLEUtil.request("api/s/resource", "DELETE", null, { resourceid : treeNode.id },
											function(data, textStatus, jqXHR){
												if (data.success) {
													self.$bvToast.toast(`记录删除成功！`, {
														title: '提示 ',
														toaster: 'b-toaster-top-center',
														solid: true
													});
													if ( treeNode.id === self.queryParam.resourceid) {
														self.list = [];
														self.resetContent();
													}
													self.ztreeObj.removeNode(treeNode)
												}
											},
											function(jqXHR, textStatus, errorThrown){

											});
								});
								return false;
							}
						}
					}
				},
			},
			methods:{
                getRolesNumber(){
                    JLEUtil.request("api/s/roles", "POST",null ,null ,
                        (data, textStatus, jqXHR)=>{
                        // success
                        if (data){
                            this.roleno = data.rows[0].roleno;
                        }
                    },
                        (jqXHR, textStatus, errorThrown)=>{
                    }
                );
                },
				// 查询菜单树形数据 api/s/resource/all
				queryResourceAll(subsCode){

					JLEUtil.request("api/s/resource/all/root", "POST",null ,null ,
							(data, textStatus, jqXHR)=>{
								// success
								if (data){
									this.resourceTree = data;
									this.initzTree(data, this.ZTREE_SETTINGS);
								}
							},
							(jqXHR, textStatus, errorThrown)=>{
								//error
								this.$bvToast.toast(`加载菜单数据失败！ ${errorThrown}`, {
									title: '提示 ',
									toaster: 'b-toaster-top-center',
									solid: true
								});
							}
					);
				},
				initzTree(data, setting){
					this.ztreeObj = $.fn.zTree.init($("#resourceTree"), setting, data);
					this.$nextTick(()=>{
						this.ztreeObj.expandAll(true);
						let nodes = this.ztreeObj.getNodes();
						console.log(nodes);
						if (nodes && nodes.length > 0) {
							let node = nodes[0];
							this.ztreeObj.selectNode(node);
							this.$nextTick(()=> this.handleTreeNodeClick(node));
						}
					});
				},
				handleTreeNodeClick(node){
					this.selectResource = node;
					if (node && node.id) {
						JLEUtil.request(`api/s/resource/${node.id}`, "GET", null, null, (data, textStatus, jqXHR)=>{
							this.queryParam.resourceid = data.rows.resourceid;
							this.queryParam.cnname = data.rows.cnname;
							this.queryParam.url = data.rows.url;
							this.queryParam.parentid = data.rows.parentid;
							this.queryParam.orderid = data.rows.orderid;
							this.queryParam.systempk =data.rows.systempk;
							this.submitQry(true)
						})
					}
				},
				destroyZtreeObj(){ //销毁ztree对象
					$.fn.zTree.destroy(this.ztreeObj.setting.treeId);
					if(this.ztreeObj.setting)
						this.ztreeObj.setting.treeObj = null  ;
				},
				// load subDict
				loadDict(){
					JLEUtil.request('api/s/subs/info/all', "POST", null, null, (data, textStatus, jqXHR)=>{
						if (data.success) {
							this.subDict = data.rows.map((value, index)=>{
								return {
									enname: value.subsCode,
									cnname: value.subsName,
								}
							})
						}
					})
				},
				addResource(addRootFlag, treeNode){
					if (addRootFlag) {
						this.resourceModelTitle = "资源操作新增一级菜单";
						this.resourceModelObj.parentid = "root";

					} else {
						this.resourceModelTitle = "资源操作新增";
						this.resourceModelObj = $.extend({}, DEFAULT_RESOURCE_MODEL);
						this.resourceModelObj.parentid = treeNode.id;
						this.resourceModelObj.systempk = this.queryParam.systempk;
						this.resourceModelObj.roleno = this.roleno;
					}
					this.readonly = false;
					this.showResourceModel = true;
				},
				// flag true 为更新 false 为新增
				saveResource(flag){
					let param = $.extend({}, flag ? this.queryParam : this.resourceModelObj);
					param.systempk = param.systempk;

					let requestOptions = {
						url : "api/s/resource",
						type : "POST",
						dataObj: param,
						success: (data)=>{
							this.$bvToast.toast(data.message, {
								title: '提示 ',
								toaster: 'b-toaster-top-center',
								solid: true
							});
							this.loading = false;
							this.closeResourceModel();
							if(flag) {
								this.selectResource.id = param.resourceid;
								this.selectResource.text = param.cnname;
								this.selectResource.parentId = param.parentid;
								this.selectResource.url = param.url;
								this.ztreeObj.updateNode(this.selectResource);
							} else {
                                //资源定义
                                var actionJsondate={
                                    descr:'菜单访问',
                                    resourceid:param.resourceid,
                                    actid:'visit',
                                };
                                console.log(actionJsondate);
                                JLEUtil.request("api/s/resourceaction","POST",null,actionJsondate,
                                    function(data, textStatus, jqXHR){},requestOptions.error);
                                // 资源操作
                                var roleJsondate={
                                    roleno:param.roleno,
                                    resourceid:param.resourceid,
                                    actIdStr:'visit',
                                };
                                debugger
                                JLEUtil.request("api/s/role/right/save","POST",null,actionJsondate,function(data, textStatus, jqXHR){},requestOptions.error);

								this.ztreeObj.addNodes(param.parentid == "root" ? null : this.selectResource,
								[{
									id : param.resourceid,
									text: param.cnname,
									parentId: param.parentid,
									url: param.url,
									isParent : true,
								}])
							}
						},
						error: (jqXHR, textStatus, errorThrown)=>{
							this.loading = false;
							this.$bvToast.toast("提交失败", {
								title: '提示 ',
								toaster: 'b-toaster-top-center',
								solid: true
							});
						}
					};
					if (flag) {
						requestOptions.type = "PUT";
					} else {
						requestOptions.type = "POST";
					}

					this.loading = true;
					let self = this;
					let submitFunc = (requestOptions)=>{
						JLEUtil.request(requestOptions.url, requestOptions.type, null,
								requestOptions.dataObj,
								requestOptions.success,
								requestOptions.error
						);
					};
					if (flag) {
						submitFunc.call(this, requestOptions);
					} else {
						this.$refs.resourceForm.validate().then(success => {
							if (!success) {
								this.loading = false;
								return;
							}
							submitFunc.call(this, requestOptions);
						});
					}
				},
				closeResourceModel(){
					this.showResourceModel = false;
					this.resourceModelObj = {};
				},

				onRowSelected(items){
					this.selected = items[0];
				},
				submitQry(page){
					if (!this.queryParam.resourceid) {
						// 资源ID没有值， 不请求
						return;
					}
					if (page == true) {
						this.pageInfo.page = 1;
					}
					let self = this;
					let param = {};
					param.page = self.pageInfo.page;
					param.size = self.pageInfo.size;
					param.resourceid = self.queryParam.resourceid;
					JLEUtil.requestForm("api/s/resourceactions", "POST", null, param,
							function(data, textStatus, jqXHR){
								self.list = data.rows;
								self.pageInfo.total = data.total;
							},
							function(jqXHR, textStatus, errorThrown){

							});
				},
				resetContent(){
					this.queryParam.resourceid = "";
					this.queryParam.cnname = "";
					this.queryParam.url = "";
					this.queryParam.parentid = "";
					this.queryParam.orderid = "";
				},
				toAddPage(){
                    this.$bvModal.show('bv-modal-example');
					this.opType = "add";
				},
				toModifyRecord(){
					if (!this.selected) {
						this.$bvToast.toast(`请选择一行数据`, {
							title: '提示 ',
							toaster: 'b-toaster-top-center',
							solid: true
						});
						return;
					}
                    this.$bvModal.show('bv-modal-example');
					this.opType = "update";
				},
				delRecord(){
					if (!this.selected) {
						this.$bvToast.toast(`请选择一行数据`, {
							title: '提示 ',
							toaster: 'b-toaster-top-center',
							solid: true
						});
						return;
					}
					if(this.selected.actid=="visit"){
                        this.$bvToast.toast(`菜单访问权限不可删除！`, {
                            title: '提示 ',
                            toaster: 'b-toaster-top-center',
                            solid: true
                        });
                        return;
					}
					let self = this;
					this.$bvModal.msgBoxConfirm(`你确定要删除这条记录?`, {
						title: '删除提示',
						size: 'sm',
						buttonSize: 'sm',
						okVariant: 'success',
						headerClass: 'p-2 border-bottom-0',
						footerClass: 'p-2 border-top-0',
						cancelTitle: "取消",
						okTitle: "确定",
						centered: true
					}).then(value => {
						if (!value) return;
						JLEUtil.request("api/s/resourceaction", "DELETE", null,
								{
									actid : this.selected.actid,
									resourceid: this.selected.resourceid
								},
								function(data, textStatus, jqXHR){
									self.$bvToast.toast(`记录删除成功！`, {
										title: '提示 ',
										toaster: 'b-toaster-top-center',
										solid: true
									});
									self.submitQry(true);
								},
								function(jqXHR, textStatus, errorThrown){

								});
					})
				},
				toViewPage(){
					if (!this.selected) {
						this.$bvToast.toast(`请选择一行数据`, {
							title: '提示 ',
							toaster: 'b-toaster-top-center',
							solid: true
						});
						return;
					}
                    this.$bvModal.show('bv-modal-example');
					this.opType = "view";
				},
				saveInfo(){

					let requestOptions = {
						url : "api/s/resourceaction",
						type : "POST",
						dataObj: this.dataObj,
						success: (data)=>{
							this.$bvToast.toast(data.message, {
								title: '提示 ',
								toaster: 'b-toaster-top-center',
								solid: true
							});
							this.loading = false;
							this.closeModel();
							this.submitQry();
						},
						error: (jqXHR, textStatus, errorThrown)=>{
							this.loading = false;
							this.$bvToast.toast("提交失败", {
								title: '提示 ',
								toaster: 'b-toaster-top-center',
								solid: true
							});
						}
					};
					if (this.opType == "add") {
						requestOptions.type = "POST";
					} else if (this.opType == "update") {
						requestOptions.type = "PUT";
					}

					this.loading = true;
					let self = this;
					this.$refs.form.validate().then(success => {
						if (!success) {
							this.loading = false;
							return;
						}
						JLEUtil.request(requestOptions.url, requestOptions.type, null,
								requestOptions.dataObj,
								requestOptions.success,
								requestOptions.error
						);
					});
				},
				closeModel(){
					this.show = false;
					this.modelData = {};
					this.opType = "";
				},
                //初始化获取操作系统列表
                init(){
                    let self = this;
                    $.ajax({
                        type: 'POST',
                        url: '../../api/s/subs/info/all',
                        data: {
                        },
                        success: function(data) {
                            if(data){
                                //将获取的数组赋值给result_list，用于生成选项
                                self.result_list = data.rows;
                                $("#systempk").selectpicker({
                                    multiple: true,
                                    actionsBox: true
                                })
                            }
                        }
                    });
                },
			},
			mounted(){
				this.queryResourceAll("bpm");
				this.loadDict();
				this.init();
                this.getRolesNumber();
			},
			beforeDestroy(){
				this.destroyZtreeObj();
			},
		})
	});

</script>
</head>
<body>
<div class="headerPage"></div>
<div id="app">
	<b-container fluid>
		<b-row align-h="center">
			<b-col sm="8" align-self="center">
				<!-- 面包屑导航 -->
				<!--<b-breadcrumb :items="paths" @click.prevent="handlePath"></b-breadcrumb>-->
			</b-col>
		</b-row>
		<b-row>
			<b-col>
				<div class="alert alert-secondary" role="alert">
					<b-row>
						<b-col cols="6">
							菜单资源
						</b-col>
						<b-col>
							<b-button  size="sm" variant="primary" @click="addResource(true)">新增一级菜单</b-button>
						</b-col>
					</b-row>
				</div>
				<!--<b-form-select  type="text" value="bpm" name="systempk"  @change="queryResourceAll" placeholder="所属子系统"   :disabled="readonly">-->
					<!--<option v-bind:value="item.subsCode" v-for="item in result_list">-->
						<!--{{item.subsName}}-->
					<!--</option>-->
				<!--</b-form-select>-->
				<div id="resourceTree" class="ztree"></div>

			</b-col>
			<b-col cols="10">
				<div class="alert alert-dark" role="alert">
					资源信息
				</div>
				<div class="container-fluid mt-3">
					<div class="row">
						<div class="col-sm-12 search-box">
							<form role="form" style="text-align: right"  id="formData" class="row">
								<div class="form-group col-sm-4">
									<b-form-group label-cols="4" label-cols-lg="4" label="资源ID" >
										<b-form-input  v-model="queryParam.resourceid" readonly></b-form-input>
									</b-form-group>
								</div>
								<div class="form-group col-sm-4">
									<b-form-group label-cols="4" label-cols-lg="4" label="资源名称" >
										<b-form-input  v-model="queryParam.cnname"></b-form-input>
									</b-form-group>
								</div>
								<div class="form-group col-sm-4">
									<b-form-group label-cols="4" label-cols-lg="4" label="资源URL" >
										<b-form-input  v-model="queryParam.url"></b-form-input>
									</b-form-group>
								</div>
								<div class="form-group col-sm-4">
									<b-form-group label-cols="4" label-cols-lg="4" label="上级资源ID" >
										<b-form-input  v-model="queryParam.parentid" readonly></b-form-input>
									</b-form-group>
								</div>
								<div class="form-group col-sm-4">
									<b-form-group label-cols="4" label-cols-lg="4" label="序号" >
										<b-form-input  v-model="queryParam.orderid"></b-form-input>
									</b-form-group>
								</div>
								<div class="form-group col-sm-4">
									<b-form-group label-cols="4" label-cols-lg="4" label="所属子系统" >
										<b-form-select  type="text" v-model="dataObj.systempk" name="systempk"  placeholder="所属子系统"  :disabled="readonly">
											<option v-bind:value="item.subsCode" v-for="item in result_list">
												{{item.subsName}}
											</option>
										</b-form-select>
									</b-form-group>
								</div>

								<div class="control-group col-sm-2">
									<div class="text-center">
										<b-button variant="primary" @click="saveResource(true)" :disabled="loading">
											<div v-if="loading">
												<b-spinner small></b-spinner>
												保存中...
											</div>
											<span v-else="loading">保存资源信息</span>
										</b-button>
									</div>
								</div>
							</form>
							<div class="row"></div>
							<!-- table -->
						</div>
						<div class="form-group col-sm-12 ">
							<div class="text-left">
								<b-button variant="primary" @click="submitQry(true)">&nbsp;&nbsp;刷&nbsp;&nbsp;新&nbsp;&nbsp;</b-button>
								<b-button variant="primary" @click="toAddPage">&nbsp;&nbsp;新&nbsp;&nbsp;增&nbsp;&nbsp;</b-button>
								<b-button variant="primary" @click="toModifyRecord">&nbsp;&nbsp;修&nbsp;&nbsp;改&nbsp;&nbsp;</b-button>
								<b-button variant="primary" @click="delRecord">&nbsp;&nbsp;删&nbsp;&nbsp;除&nbsp;&nbsp;</b-button>
								<b-button variant="primary" @click="toViewPage">&nbsp;&nbsp;查&nbsp;&nbsp;看&nbsp;&nbsp;</b-button>
							</div>
						</div>
					</div>
				</div>
				<div class="container-fluid">
					<!-- table start -->
					<b-table responsive hover selectable bordered fixed striped small
							 show-empty empty-text="查询列表为空"
							 @row-selected="onRowSelected"
							 selected-variant="primary"
							 select-mode="single" :fields="fields" :items="list" >
						<template v-slot:table-colgroup="scope">
							<col
									v-for="field in scope.fields"
									:key="field.key"
									:style="{ width: '180px' }"
							>
						</template>
						<template v-slot:cell()="data" >
							<div class="text-truncate">{{ data.value }}</div>
						</template>
					</b-table>
					<div class="float-right">
						<b-pagination
								v-model="pageInfo.page"
								:total-rows="pageInfo.total"
								:per-page="pageInfo.size"
								@change="submitQry"
						></b-pagination>
					</div>
					<!-- table end -->
				</div>
			</b-col>
		</b-row>
	</b-container>

	<b-modal  v-model="show" id="bv-modal-example" :title="modelTitle" size="xl"
			  scrollable
			  no-close-on-backdrop
			  no-close-on-esc>
		<b-container fluid>
			<validation-observer ref="form">
				<form role="form" >
					<div class="row">
						<div class="col-sm-4">
							<validation-provider name="actid" :rules="{ required: true }" v-slot="validationContext">
								<b-form-group label="操作ID" label-cols-sm="4" label-align-sm="right">
									<b-form-input type="text" v-model="dataObj.actid" :readonly="readonly"
												  :state="getValidationState(validationContext)"
												  name="actid" placeholder="操作ID"></b-form-input>
									<b-form-invalid-feedback >操作ID不能为空</b-form-invalid-feedback>
								</b-form-group>
							</validation-provider>
						</div>
						<div class="col-sm-4">
							<validation-provider name="descr" :rules="{ required: true }" v-slot="validationContext">
								<b-form-group label="操作描述" label-cols-sm="4" label-align-sm="right">
									<b-form-input type="text" v-model="dataObj.descr"
												  :state="getValidationState(validationContext)"
												  name="descr" placeholder="操作描述"  :readonly="readonly"></b-form-input>
									<b-form-invalid-feedback >操作描述不能为空</b-form-invalid-feedback>
								</b-form-group>
							</validation-provider>
						</div>
						<div class="col-sm-4">
							<b-form-group label="资源ID" label-cols-sm="4" label-align-sm="right">
								<b-form-input type="text" v-model="dataObj.resourceid" name="resourceid"  placeholder="资源ID" readonly></b-form-input>
							</b-form-group>
						</div>
					</div>
				</form>
			</validation-observer>
		</b-container>
		<template v-slot:modal-footer>
			<div class="control-group col-sm-12">
				<div class="text-center">
					<b-button variant="primary" @click="saveInfo" :disabled="loading">
						<div v-if="loading">
							<b-spinner small></b-spinner>
							保存中...
						</div>
						<span v-else="loading">保存</span>
					</b-button>
					<b-button variant="secondary" @click="closeModel" :disabled="loading">返回</b-button>
				</div>
			</div>
		</template>
	</b-modal>

	<b-modal  v-model="showResourceModel" :title="resourceModelTitle" size="xl"
			  scrollable
			  no-close-on-backdrop
			  hide-header-close
			  no-close-on-esc>
		<b-container fluid>
			<validation-observer ref="resourceForm">
				<form role="form" >
					<div class="row">
						<div class="col-sm-6">
							<validation-provider name="resourceid" :rules="{ required: true }" v-slot="validationContext">
								<b-form-group label="资源ID" label-cols-sm="4" label-align-sm="right">
									<b-form-input type="text" v-model="resourceModelObj.resourceid" :readonly="readonly"
												  :state="getValidationState(validationContext)"
												  name="resourceid" placeholder="资源ID"></b-form-input>
									<b-form-invalid-feedback >资源ID不能为空</b-form-invalid-feedback>
								</b-form-group>
							</validation-provider>
						</div>
						<div class="col-sm-6">
							<validation-provider name="cnname" :rules="{ required: true }" v-slot="validationContext">
								<b-form-group label="资源名称" label-cols-sm="4" label-align-sm="right">
									<b-form-input type="text" v-model="resourceModelObj.cnname"
												  :state="getValidationState(validationContext)"
												  name="cnname" placeholder="资源名称"  :readonly="readonly"></b-form-input>
									<b-form-invalid-feedback >资源名称不能为空</b-form-invalid-feedback>
								</b-form-group>
							</validation-provider>
						</div>
						<div class="col-sm-6">
							<b-form-group label="资源URL" label-cols-sm="4" label-align-sm="right">
								<b-form-input type="text" v-model="resourceModelObj.url" name="url"  placeholder="资源URL" :readonly="readonly"></b-form-input>
							</b-form-group>
						</div>
						<div class="col-sm-6">
							<b-form-group label="上级资源ID" label-cols-sm="4" label-align-sm="right">
								<b-form-input type="text" v-model="resourceModelObj.parentid" name="parentid"  placeholder="上级资源ID" readonly></b-form-input>
							</b-form-group>
						</div>
						<div class="col-sm-6">
							<b-form-group label="序号" label-cols-sm="4" label-align-sm="right">
								<b-form-input type="text" v-model="resourceModelObj.orderid" name="orderid"  placeholder="序号" :readonly="readonly"></b-form-input>
							</b-form-group>
						</div>
						<!--<div class="col-sm-6">-->
							<!--<b-form-group label-cols="4"  label-align-sm="right" label-cols-lg="4" label="所属子系统" >-->
								<!--<b-form-select  type="text" v-model="dataObj.systempk" name="systempk"  placeholder="所属子系统"  :disabled="readonly">-->
									<!--<option v-bind:value="item.subsCode" v-for="item in result_list">-->
										<!--{{item.subsName}}-->
									<!--</option>-->
								<!--</b-form-select>-->
							<!--</b-form-group>-->
						<!--</div>-->
					</div>
				</form>
			</validation-observer>
		</b-container>
		<template v-slot:modal-footer>
			<div class="control-group col-sm-12">
				<div class="text-center">
					<b-button variant="primary" @click="saveResource(false)" :disabled="loading">
						<div v-if="loading">
							<b-spinner small></b-spinner>
							保存中...
						</div>
						<span v-else="loading">保存</span>
					</b-button>
					<b-button variant="secondary" @click="closeResourceModel" :disabled="loading">返回</b-button>
				</div>
			</div>
		</template>
	</b-modal>
</div>
<div class="footerPage"></div>
</body>
</html>
